package com.cheng.example.atguigu.view2;

import java.util.ArrayList;

public class ArrayListDemo {

    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList();
        list.add(1);

        ArrayList arrayList1 = new ArrayList(list);
        arrayList1.add(1);
        arrayList1.add("1");

    }
}


class ArrayTest{


    public void f1(ArrayList<? extends Object> c) {
        for (Object e : c) {
            System.out.println(e);
        }
    }


    public void f2(ArrayList<? super Object> c) {
        for (Object e : c) {
            System.out.println(e);
        }
    }


    public static void main(String[] args) {
        ArrayTest arrayTest = new ArrayTest();
        arrayTest.f1(new ArrayList<>());
    }
}
